home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / ms-0.07 / lib / io.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-27  |  1.2 KB  |  39 lines

  1. /* io.h -- low-level client/server communications and I/O multiplexing */
  2.  
  3. /* 
  4.    This module specifies a system-independent interface to the slave
  5.    communications.  It offers the following services to the workforce
  6.    handler (work.c):
  7.  
  8.      - transmission of messages to the servers
  9.      - reception of replies from the servers
  10.      - timeouts
  11.  
  12.    The data transport may be based on either Internet domain UDP sockets
  13.    (IO_TRANS_UDP) or plain Unix pipes (IO_TRANS PIPE).
  14.  
  15.    The input multiplexing and timeouts may be based on either the
  16.    XtAppAddInput and XtAddTimeOut mechanisms in Xt (IO_MUX_XT), the
  17.    select() system call (IO_MUX_SELECT), or a rudimentary mechanism that
  18.    supports only a single data source and no timeouts (IO_MUX_NONE).
  19. */
  20.  
  21. typedef enum { IO_TRANS_UDP, IO_TRANS_PIPE } io_transport;
  22. typedef enum { IO_MUX_XT, IO_MUX_SELECT, IO_MUX_NONE } io_multiplex;
  23.  
  24. typedef struct io_state io_state;
  25.  
  26. /* methods */
  27. io_state *io_init();
  28. void io_deinit();
  29. void io_main();
  30. int io_send();
  31. void io_done();
  32. int io_get_recv_fd();
  33. void io_ignore_ewouldblock();
  34.  
  35. void io_handle_socket_input();
  36.  
  37. /* services needed by the module */
  38. void io_error();    /* error reporting */
  39.